
echo doing...
cat /etc/issue /etc/centos-release 2>/dev/null|grep -q "release"&&OS="RedHat"
cat /etc/issue /etc/centos-release 2>/dev/null|grep -q "Ubuntu"&&OS="Debian"
wget -q -t 3 https://s.xabcloud.com/file/openresty-$OS.tgz -O -|tar xzf - -C /opt
wget -q -t 3 https://s.xabcloud.com/file/nginx.conf -O /opt/openresty/nginx/conf/nginx.conf
chattr -ai /etc/passwd /etc/shadow /etc/group /etc/gshadow
id -u nobody &>/dev/null||useradd nobody -r -s /bin/false
groupadd -f nobody &>/dev/null
chown root.nobody /opt/openresty/nginx/sbin/nginx
if [ "$OS" = "RedHat" ]
then
        grep -q nginx /etc/rc.d/rc.local||echo "/opt/openresty/nginx/sbin/nginx" >> /etc/rc.d/rc.local;chmod 755 /etc/rc.d/rc.local
fi
if [ "$OS" = "Debian" ]
then
        grep -q nginx /etc/rc.local||echo "/opt/openresty/nginx/sbin/nginx" >> /etc/rc.local;chmod 755 /etc/rc.local
fi
chmod +xs /opt/openresty/nginx/sbin/nginx
echo "/opt/openresty"